<?php


namespace app\admin\service;


use app\common\service\WarmUpCache;
use app\common\service\Redis;

class UsersService
{
    public static function getUserGroupIdByUserId($user_id)
    {
        $userInfo = self::getUserInfoByUserId($user_id);
        return $userInfo['group_id'];
    }

    public static function getUserInfoByUserId($user_id)
    {
        //缓存中没有，从mysql中读取
        //$data = Redis::tableGet('users',$user_id);
        //if (!$data) {
        //    $users =  WarmUpCache::users();
        //    foreach ($users as $user) {
        //        if($user['id'] == $user_id){
        //            return $user;
        //        }
        //    }
        //}
        //return $data;
    }
}